<?php
namespace app\common\config\model;


use app\common\system\logic\UserLogic;
use think\Model;
use think\model\concern\SoftDelete;

class ConfigStore extends Model
{
    use SoftDelete;
    protected $defaultSoftDelete = 0;

    public function getUserAttr($value, $data) {
        if (empty($data['user_id'])) {
            return [
                'id'    => '',
                'realname'  => ''
            ];
        }

        $userLogic = new UserLogic();
        return $userLogic->getUser($data['user_id'], ['id', 'realname', 'work_wechat']);
    }
}